import logging
import signal

LOG_LEVEL = logging.DEBUG
LOG_FMT = '%(asctime)s %(levelname)s %(threadName)s %(name)s#%(lineno)s %(message)s'
logging.basicConfig(level=LOG_LEVEL, format=LOG_FMT)

TIMEOUT = 3
ADDRESS = 'localhost', 19888

RUNING = True


def _exit(signum, frame):
    global RUNING
    logging.info('准备关闭了...')
    RUNING = False


signal.signal(signal.SIGINT, _exit)
signal.signal(signal.SIGTERM, _exit)
